package 实验三;

public class Teacher extends Person {
    // 子类特有属性
    private Course taughtCourse;

    // 子类构造方法：通过 super() 调用父类构造
    public Teacher(String id, String name, String gender, Course taughtCourse) {
        super(id, name, gender); // 必须在第一行调用父类构造
        this.taughtCourse = taughtCourse;
    }

    // 子类业务方法：打印课表（重写/扩展父类逻辑）
    public void printSchedule() {
        super.printBasicInfo(); 
        System.out.println("所授课程：" + taughtCourse.getName() + "（地点：" + taughtCourse.getLocation() + "，时间：" + taughtCourse.getTime() + "）");
    }

    // Getter 方法
    public Course getTaughtCourse() {
        return taughtCourse;
    }
}
